<template>
  <footer class="footer">
    <ul>
      <router-link tag="li" :to="item.path" v-for = " (item, index) of list " :key = "index"><!--此行代码用于跳转路由类似于（a标签）-->
         <span :class="item.icon"></span>
        <p>{{item.name}}</p>
      </router-link>
    </ul>
  </footer>
</template>

<script>
export default {
  data () {
    return {
      list: [{
        name: '推荐',
        icon: 'iconfont icon-tuijian',
        path: '/recommend'
      }, {
        name: '发现',
        icon: 'iconfont icon-icon-test1',
        path: '/discover'
      }, {
        name: '订单',
        icon: 'iconfont icon-dingdan',
        path: '/order'
      }, {
        name: '我的',
        icon: 'iconfont icon-wode',
        path: '/my'
      }]
    }
  }
}
</script>

<style lang="scss" scoped>
@import '@/lib/reset.scss';
.footer {
  ul {
    @include rect(100%, 100%);
    @include flexbox();
    li {
      @include flex();
      @include rect(auto, 100%);
      @include flexbox();
      @include justify-content(center);
      @include flex-direction(column);
      @include align-items();
      &.router-link-active{
        @include text-color(#f66);
      }
      span {
       font-size:22px;
       height:30px;
      }
      p {

      }
    }
  }
}
</style>
